import {createRouter, createWebHistory} from 'vue-router'
import Login from "../components/login/Login.vue";
import AppHome from "../components/AppHome.vue";
import SelfPage from "../components/common/SelfPage.vue";
import SelfPage2 from "../components/common/SelfPage2.vue";
import SelfPage3 from "../components/common/SelfPage3.vue";
import Home from "../components/common/Home.vue";
import TagPage1 from "../components/tagPage/TagPage1.vue";
import TagPage2 from "../components/tagPage/TagPage2.vue";
import TagPage3 from "../components/tagPage/TagPage3.vue";
import TagPage4 from "../components/tagPage/TagPage4.vue";
import DetailPage from "../components/ghhz/view/product/DetailPage.vue";
import ReleaseTo from "../components/ghhz/view/product/ReleaseTo.vue";
import ReleaseSuccess from "../components/ghhz/view/product/ReleaseSuccess.vue";

const routes = [
    {
        path: '/',
        redirect: '/AppHome/Home'
    },
    {
        path: '/AppHome/Home',
        meta: {requiresAuth: true},
        component: Home,
    },
    {
        path: '/AppHome/DetailPage',
        meta: {requiresAuth: true},
        component: DetailPage,
    },
    {
        path: '/AppHome/ReleaseTo',
        meta: {requiresAuth: true},
        component: ReleaseTo,
    },
    {
        path: '/AppHome/ReleaseSuccess',
        meta: {requiresAuth: true},
        component: ReleaseSuccess,
    },
    {
        path: '/AppHome/TagPage2',
        meta: {requiresAuth: true},
        component: TagPage2,
    },
    {
        path: '/AppHome',
        component: AppHome,
        meta: {requiresAuth: true},
        children: [
            {
                path: 'Home',
                component: Home,
                children:[
                    {
                        path:'TagPage1',
                        component: TagPage1,
                    },
                    {
                        path:'TagPage2',
                        component: TagPage2,
                    },
                    {
                        path:'TagPage3',
                        component: TagPage3,
                    },
                    {
                        path:'TagPage4',
                        component: TagPage4,
                    },
                ]
            },
            {
                path: 'SelfPage',
                component: SelfPage
            },
            {
                path: 'SelfPage2',
                component: SelfPage2
            },
            {
                path: 'SelfPage3',
                component: SelfPage3
            }
        ]
    },
    {
        path: '/Login',
        name: 'Login',
        component: Login
    },
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router
